// import { TimeComponent } from './components/time/time.component'
// import { EchartsComponent } from './components/echarts/echarts.component'
import { InstallCarMapComponent } from './components/install-car-map/install-car-map.component'
import { InstallStatisticsComponent } from './components/install-statistics/installStatistics.component'
import { RenewStatisticsComponent } from './components/renew-statistics/renewStatistics.component'
import { RepairStatisticsComponent } from './components/repair-statistics/repairStatistics.component'
import { DatabaseSum } from './components/database-sum/database-sum.component'
import { MiniProgram } from './components/mini-program/mini-program.component'
import { ApiInvoke } from './components/api-invoke/api-invoke.component'
import { CarryDistance } from './components/carry-distance/carry-distance.component'
import { CarryWeight } from './components/carry-weight/carry-weight.component'
import { CarryCount } from './components/carry-count/carry-count.component'
import { TotalCarNumber } from './components/total-car-number/total-car-number.component'
import { OnlineCarNumber } from './components/online-car-number/online-car-number.component'
import { OfflineCarNumber } from './components/offline-car-number/offline-car-number.component'
import { OnlineRate } from './components/online-rate/online-rate.component'
import { TrafficEchartsMins } from './components/traffic-echarts-mins/traffic-echarts-mins.component'
import { TrafficEchartsDay } from './components/traffic-echarts-day/traffic-echarts-day.component'
import { UserApiInvoke } from './components/user-api-invoke/user-api-invoke.component'
import { ApiInvokeRank } from './components/api-invoke-rank/api-invoke-rank.component'
import { InstallFactoryDetailsComponent } from './components/install-factory-details/install-factory-details.component'
import { RenewFactoryDetailsComponent } from './components/renew-factory-details/renew-factory-details.component'
import { RepairFactoryDetailsComponent } from './components/repair-factory-details/repair-factory-details.component'
import { InventoryFactoryDetailsComponent } from './components/inventory-factory-details/inventory-factory-details.component'

// 所有组件需要继承的接口，用于数据传递
export interface Widget {
  componentData: any
}

// 组件命名(特别重要，用来标记加载的组件)
export type WidgetKey =
  // | 'time'
  // | 'echarts'
  | 'installFactoryDetails'
  | 'renewFactoryDetails'
  | 'repairFactoryDetails'
  | 'inventoryFactoryDetails'
  | 'databaseSum'
  | 'miniProgram'
  | 'apiInvoke'
  | 'carryDistance'
  | 'carryWeight'
  | 'carryCount'
  | 'totalCarNumber'
  | 'onlineCarNumber'
  | 'offlineCarNumber'
  | 'onlineRate'
  | 'trafficEchartsMins'
  | 'trafficEchartsDay'
  | 'userApiInvoke'
  | 'apiInvokeRank'
  | 'installStatistics'
  | 'renewStatistics'
  | 'repairStatistics'
  | 'installCarMap'

// 组件属性
export interface WidgetProps {
  title: string // 组件名称
  component: any // 组件对象
  description?: string // 组件描述
  componentsConfig?: string //组件常用项目Id
}

// 所有组件数据的集合
export const widgetDatas: Record<WidgetKey, WidgetProps> = {
  // time: {
  //   title: '时钟',
  //   description: '演示部件效果',
  //   component: TimeComponent,
  // },
  // echarts: {
  //   title: '实时收入',
  //   description: 'Echarts组件演示',
  //   component: EchartsComponent,
  // },
  installStatistics: {
    title: '安装统计',
    description: '安装数同比数据及安装日历',
    component: InstallStatisticsComponent,
  },
  renewStatistics: {
    title: '续费统计',
    description: '续费数同比数据及续费日历',
    component: RenewStatisticsComponent,
  },
  repairStatistics: {
    title: '维修统计',
    description: '维修数同比数据及维修日历',
    component: RepairStatisticsComponent,
  },
  installFactoryDetails: {
    title: '安装厂区详情',
    description: '各项目/厂区安装数据详情',
    component: InstallFactoryDetailsComponent,
  },
  renewFactoryDetails: {
    title: '续费厂区详情',
    description: '各项目/厂区续费数据详情',
    component: RenewFactoryDetailsComponent,
  },
  repairFactoryDetails: {
    title: '维修厂区详情',
    description: '各项目/厂区维修数据详情',
    component: RepairFactoryDetailsComponent,
  },
  inventoryFactoryDetails: {
    title: '库存厂区详情(实时)',
    description: '各厂区站点主机库存数据详情(实时统计)',
    component: InventoryFactoryDetailsComponent,
  },
  installCarMap: {
    title: '安装车辆地图',
    description: '地图展示各地安装车辆数',
    component: InstallCarMapComponent,
  },
  databaseSum: {
    title: '热库数据总量',
    description: '',
    component: DatabaseSum,
  },
  miniProgram: {
    title: '小程序人数统计[总注册|总访问]',
    description: '小程序注册、访问总量统计',
    component: MiniProgram,
  },
  apiInvoke: {
    title: 'API接口调用[前天|昨天|今天]',
    description: '',
    component: ApiInvoke,
  },
  carryDistance: {
    title: '运载里程',
    description: '车辆运载里程总和',
    component: CarryDistance,
  },
  carryWeight: {
    title: '运载重量',
    description: '车辆运载重量总和',
    component: CarryWeight,
  },
  carryCount: {
    title: '运载次数',
    description: '车辆运载次数总和',
    component: CarryCount,
  },
  totalCarNumber: {
    title: '车辆总数',
    description: '安装车辆设备总数',
    component: TotalCarNumber,
  },
  onlineCarNumber: {
    title: '在线车辆数',
    description: '安装车辆设备在线数总和',
    component: OnlineCarNumber,
  },
  offlineCarNumber: {
    title: '离线车辆数',
    description: '安装车辆设备离线数总和',
    component: OfflineCarNumber,
  },
  onlineRate: {
    title: '车辆在线率',
    description: '安装车辆在线率',
    component: OnlineRate,
  },
  trafficEchartsMins: {
    title: '流量统计图(分)',
    component: TrafficEchartsMins,
  },
  trafficEchartsDay: {
    title: '流量统计图(时)',
    component: TrafficEchartsDay,
  },
  userApiInvoke: {
    title: '用户API调用排名Top5',
    component: UserApiInvoke,
  },
  apiInvokeRank: {
    title: 'API调用排名Top5',
    component: ApiInvokeRank,
  }
}
